﻿@using BMap;

<!DOCTLongitudePE html>

<html>
<head>
    <meta name="viewport" content="width=device-width"/>
    <meta charset="UTF-8"/>
    <title>百度地图：MVC实例</title>
    <style type="text/css">
        #container {width: 100%;max-width: 960px;font-family: "Microsoft LongitudeaHei", Arial;margin: 20px auto 0 auto;}
        hr { margin: 20px 0; }
    </style>
    <script>
        function alertMe(marker) {
            alert(marker.K);
        }
    </script>
</head>
<body>
    <div id="container">
        <h2>百度地图Mvc实例</h2>
        <hr/>
        <div id="map1" style="width: 100%; height: 500px;"></div>
        @Html.BaiduMap("map1", 104.097334, 30.556514, 13, new[]
        {
            new MapControl
            {
                ControlType = MapControlType.ScaleControl,
                Option = new MapControlOption
                {
                    X = 30,
                    Y = 10,
                    Anchor = MapAnchorEnum.BMAP_ANCHOR_TOP_LEFT
                }
            },
            new MapControl
            {
                ControlType = MapControlType.GeolocationControl,
                Option = new MapControlOption
                {
                    X = 10,
                    Y = 10,
                    Anchor = MapAnchorEnum.BMAP_ANCHOR_TOP_RIGHT
                }
            }
        })
        <div id="map2" style="width: 100%; height: 500px"></div>
        @Html.BaiduMap("map2", 104.073025, 30.550597, 12, new[]
        {
            new MapMarker
            {
                Draggable = true,
                Latitude = 104.074597,
                Longitude = 30.550458,
                OnClientClick = "alertMe",
            }
        })
        <hr/>
        <a href="/BaiduMap.aspx">WebForm实例</a>
    </div>
</body>
</html>